import request from '@/utils/request'
import to from '@/utils/awaitTo'
export function loginAPI({ mobile, password }) {
  return to(request({
    url: '/sys/login',
    method: 'POST',
    data: {
      mobile,
      password
    }
  }))
}

export function getUserProfileAPI() {
  return request({
    url: '/sys/profile',
    method: 'POST'
  })
}
/**
 * 用户 - 获取头像
 * @description: 获取用户头像
 * @param {*} id 用户id
 * @return {*}
 */
export function getUserPhotoAPI(id) {
  return request({
    url: `/sys/user/${id}`
  })
}
export function updateDepartmentsAPI(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
